/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.aliyuncs.ccc.transform.v20200701;

import com.aliyuncs.ccc.model.v20200701.GetHistoricalCampaignReportResponse;
import com.aliyuncs.ccc.model.v20200701.GetHistoricalCampaignReportResponse.Data;
import com.aliyuncs.transform.UnmarshallerContext;


public class GetHistoricalCampaignReportResponseUnmarshaller {

	public static GetHistoricalCampaignReportResponse unmarshall(GetHistoricalCampaignReportResponse getHistoricalCampaignReportResponse, UnmarshallerContext _ctx) {
		
		getHistoricalCampaignReportResponse.setRequestId(_ctx.stringValue("GetHistoricalCampaignReportResponse.RequestId"));
		getHistoricalCampaignReportResponse.setCode(_ctx.stringValue("GetHistoricalCampaignReportResponse.Code"));
		getHistoricalCampaignReportResponse.setHttpStatusCode(_ctx.integerValue("GetHistoricalCampaignReportResponse.HttpStatusCode"));
		getHistoricalCampaignReportResponse.setMessage(_ctx.stringValue("GetHistoricalCampaignReportResponse.Message"));

		Data data = new Data();
		data.setCallsConnected(_ctx.longValue("GetHistoricalCampaignReportResponse.Data.CallsConnected"));
		data.setCallsDialed(_ctx.longValue("GetHistoricalCampaignReportResponse.Data.CallsDialed"));
		data.setCallsAbandoned(_ctx.longValue("GetHistoricalCampaignReportResponse.Data.CallsAbandoned"));
		data.setConnectedRate(_ctx.floatValue("GetHistoricalCampaignReportResponse.Data.ConnectedRate"));
		data.setAnswerRate(_ctx.floatValue("GetHistoricalCampaignReportResponse.Data.AnswerRate"));
		data.setAbandonedRate(_ctx.floatValue("GetHistoricalCampaignReportResponse.Data.AbandonedRate"));
		data.setAbandonRate(_ctx.floatValue("GetHistoricalCampaignReportResponse.Data.AbandonRate"));
		data.setOccupancyRate(_ctx.floatValue("GetHistoricalCampaignReportResponse.Data.OccupancyRate"));
		getHistoricalCampaignReportResponse.setData(data);
	 
	 	return getHistoricalCampaignReportResponse;
	}
}